package com.mybook.app.feign;

import com.mybook.app.request.SmsFeignRequest;
import com.mybook.app.response.SmsFeignResponse;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 微信小程序接口
 *
 * @author hjq
 */
@FeignClient(url = "${mybook.sms.restUrl}", name = "sms")
public interface SmsFeignClient {

    /**
     * 向微信服务器获取openid，unionid，session_key
     *
     * @param
     */
    @RequestMapping(method = RequestMethod.POST,
            value = "/2013-12-26/Accounts/{accountSid}/SMS/TemplateSMS?sig={sigParameter}",
            produces = "application/json; charset=UTF-8",
            consumes = "application/json; charset=UTF-8")
    public SmsFeignResponse sendSms(
            @RequestHeader("Authorization") String authorization,
            @PathVariable("accountSid") String accountSid,
            @PathVariable("sigParameter") String sigParameter,
            @RequestBody SmsFeignRequest smsFeignRequest
            );


}
